package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class 乘积尾零 {
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       
       public static void main(String[] args) throws IOException {
    	      BigInteger res = new BigInteger("1");
		      for(int i=0;i<10;i++){
		    	  String[]ss=br.readLine().split(" ");
		    	  for(int j=0;j<10;j++){
		    		  res=res.multiply(new BigInteger(ss[j]));
		    	  }
		      }
		      System.out.print(res);
	}
}
